package com.example.coursedesign.ui.notifications.entity;

import android.os.Parcel;
import android.os.Parcelable;

public class FamilyMember implements Parcelable {
    private int id;
    private String name;
    private String gender;
    private String relation;
    private String tel;
    private String avatar;

    // Constructor
    public FamilyMember(int id, String name, String gender, String relation, String tel, String avatar) {
        this.id = id;
        this.name = name;
        this.gender = gender;
        this.relation = relation;
        this.tel = tel;
        this.avatar = avatar;
    }

    // Getters and Setters
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getRelation() {
        return relation;
    }

    public void setRelation(String relation) {
        this.relation = relation;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    // toString method for better representation
    @Override
    public String toString() {
        return "FamilyMember{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", relation='" + relation + '\'' +
                ", tel='" + tel + '\'' +
                ", avatar='" + avatar + '\'' +
                '}';
    }

    protected FamilyMember(Parcel in) {
        id = in.readInt();
        name = in.readString();
        gender = in.readString();
        relation = in.readString();
        tel = in.readString();
        avatar = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(name);
        dest.writeString(gender);
        dest.writeString(relation);
        dest.writeString(tel);
        dest.writeString(avatar);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<FamilyMember> CREATOR = new Creator<FamilyMember>() {
        @Override
        public FamilyMember createFromParcel(Parcel in) {
            return new FamilyMember(in);
        }

        @Override
        public FamilyMember[] newArray(int size) {
            return new FamilyMember[size];
        }
    };
}